﻿using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;

namespace QuartzTest
{
    public static class QuartzSetup
    {
        public static void  AddQuartSetup(this IServiceCollection services)
        {
            //注入日志
            services.TryAddTransient<ITaskLogger, TaskLogger>();

            //注入Quartz服务实例
            services.AddSingleton<IQuartzServer, QuartzServer>();

            //注入应用关闭事件
            services.AddSingleton<IAppShutdownHandler, QuartzAppShutdownHandler>();
        }
    }
}
